{include file=header.html}
<script type="text/javascript" src="index.php?act=jslang"></script>
<script language="javascript" type="text/javascript"
	src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript"
	src="{res file=js/common.js}"></script>
<script language="javascript" type="text/javascript"
	src="{lib file=ajaxfileupload.js}"></script>
<script language="javascript" type="text/javascript"
	src="{res file=js/jquery.funkyUI.js}"></script>
<script language="JavaScript" type="text/javascript"
	src="{res file=js/lan.js}"></script>
<link href="template/style/css/style.css" type="text/css"
	rel="stylesheet" />
<style>
label.error {
	color: red;
}
.center {text-align:center;}
tr.fabric_info_list td input{width:100%;height:100%;}
.btn-2{margin-bottom:5px;}
.input-1 {line-height:18px;width:158px;}
.select-1 {line-height:18px;width:160px;}
</style>
<body>
	<div class="sub-body">
		<div class="tab-frame" style="width: 700px;">
			<div class="tab-title-1">
				<span>大货折扣</span>
			</div>
			<form id="discount_form" method="post" enctype="multipart/form-data">
			<table width="100%">
	            <tr>
	           <th width="100">折扣原因</th> <td>
	           {if $order.dis_status eq ORDER_DIS_STATUS_NO OR $order.dis_status eq ORDER_DIS_STATUS_APPROVE_FINANCE}
	           <select name="dis[dis_reason_type]"  id="dis_reason"  class="select-1" >
						<option value="0">{$lang.select_pls}</option>
						<!--{foreach from=$disreason_type_list item=disreason key=k}-->
						<option value="{$disreason.type_name}"{if $order.dis_reason_type == $disreason.type_name} selected{/if}>{$disreason.type_name}</option>
						<!--{/foreach}-->
				  </select>
	             {else}
	             {$order.dis_reason_type}
	             {/if}
	              </td>
	            <th width="100">大货折扣金额</th> <td width="60">
	            {if $order.dis_status eq ORDER_DIS_STATUS_NO OR $order.dis_status eq ORDER_DIS_STATUS_APPROVE_FINANCE}
	            <input type="text" size="6" name="dis[dis_money]" id="dis_money" value="{$order.dis_money}" />
	            {else}
	            {$order.dis_money}
	            {/if}
	            </td>
	             <th width="100">要求寄回</th> <td width="60"><input {if $order.dis_status neq ORDER_DIS_STATUS_SEND_FACTORY OR $user.role neq USER_FACTORY}disabled="disabled"{/if}  type="checkbox"  name="dis[dis_isreturn]" {if $order.dis_isreturn}checked="checked"{/if} id="dis_isreturn" value="1"/></td>
	            </tr>
	            <tr>
	            <td colspan="6">
	             {if $order.dis_status eq ORDER_DIS_STATUS_NO OR $order.dis_status eq ORDER_DIS_STATUS_APPROVE_FINANCE}
	            <textarea name="dis[dis_reason]" style="width:100%; height:60px;" id="dis_bulk"  >{$order.dis_reason}</textarea>
	            {else}
	            	<textarea style="width:100%; height:60px;" disabled="disabled">{$order.dis_reason|nl2br}</textarea>
	            {/if}
	            </td>
	            </tr>
	              <tr>
	           <th>附件</th> <td colspan="5">
	            {if ($order.dis_status eq ORDER_DIS_STATUS_NO OR $order.dis_status eq ORDER_DIS_STATUS_APPROVE_FINANCE) and ($user.role eq USER_MANAGER OR $user.role eq USER_MERCHANDISER)}
	           <input  type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_disreason}, {$order.order_id});" />
	             {/if}
	           <div id="disreason_files">
	                <!--{foreach from=$file_disreason item=file}-->
					<span><a href="download.php?id={$file.file_id}" >{$file.file_name}</a>
	                 {if ($order.dis_status eq ORDER_DIS_STATUS_NO OR $order.dis_status eq ORDER_DIS_STATUS_APPROVE_FINANCE) and ($user.role eq USER_MANAGER OR  $user.role eq USER_MERCHANDISER)}
	                <a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
	                {/if}</span>
					&nbsp;&nbsp;<!--{if !$smarty.foreach.last}--><!--{/if}--><!--{/foreach}-->
	                </div>
	                </td>
	            </tr>
	            </table>
	            <div style="text-align: center;margin-top: 8px">
	            	{if $order.dis_status eq ORDER_DIS_STATUS_NO AND ($user.role eq USER_MANAGER OR  $user.role eq USER_MERCHANDISER)}
	              <input onClick="if(confirm('确认将折扣送财务审批吗?')!=true){return false;}" class="btn-2" type="submit" name="submit" value="送财务审批"  />&nbsp;&nbsp;
	              {/if}
	               {if $order.dis_status eq ORDER_DIS_STATUS_APPROVE_FINANCE AND ($user.role eq USER_MANAGER OR $user.role eq USER_MERCHANDISER or $user.role eq USER_FINANCE)}
	              <input onClick="if(confirm('确认更新折扣吗?')!=true){return false;}" class="btn-2" type="submit" name="submit" value="更新"  />
	              {/if}
	              {if $order.dis_status eq ORDER_DIS_STATUS_APPROVE_FINANCE AND ($user.role eq USER_FINANCE)}
	              <input onClick="if(confirm('确认审批通过该大货折扣吗?')!=true){return false;}" class="btn-2" type="submit" name="submit" value="审批通过"  />
	              {/if}
	              {if $user.role eq USER_MANAGER || $user.role eq USER_FINANCE}
	              <input onClick="if(confirm('确认要重置该大货折扣吗?')!=true){return false;}" class="btn-2" type="submit" name="submit" value="重置"  />
	              {/if}
	              {if $order.dis_status eq ORDER_DIS_STATUS_SEND_FACTORY AND $user.role eq USER_FACTORY}
	              <input onClick="if(confirm('您要确认该大货折扣吗?')!=true){return false;}" class="btn-2" type="submit" name="submit" value="确认"  />
	              {/if}
	              <input onClick="history.back();" class="btn-2" type="button" name="submit" value="返回"  />
	            </div>
			</form>
		</div>
	</div>
	<div id="remsg"></div>
</body>
</html>